﻿<%@ Page Title="" Language="C#" MasterPageFile="~/default.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="HousekeepingReport.aspx.cs" Inherits="DelonixRegia.HousekeepingReport" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphPageTitle" runat="server">
    Housekeeping Reporting - Delonix Regia
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphTitle" runat="server">
    Housekeeping Reporting
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphSubtitle" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">
    <asp:Panel ID="pnlFirstStep" runat="server">
        <div id="firstStep" class="panel panel-default" style="width: 800px; margin: 0 auto;">
            <div class="panel-heading">
                Duty Allocation of staff
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            </div>
            <div class="panel-body">
                <div id="errorBox" class="alert alert-danger" style="display: none;">
                </div>



                <table class="nav-justified">
                    <div class="text-center">
                            <caption>
                                <small>Click on a date on the calendar to view a daily report, click on &quot;select month&quot; and &quot;select week&quot; to view a weekly or monthly report</small>
                            </caption>
                        </div>
                    <caption>
                        
                        
                        <br />
                        <caption>
                            <caption>
                                <tr>
                                    <td>
                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                            <ContentTemplate>
                                                <asp:Calendar ID="HKCalendar" runat="server" Caption="Select Day/Week/Month" CellSpacing="2" DayNameFormat="Full" OnDayRender="HKCalendar_DayRender" SelectionMode="DayWeekMonth" SelectMonthText="Select Month" SelectWeekText="Select Week" Width="765px"></asp:Calendar>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-center">
                                        <asp:Button ID="queryBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="queryBut_Click" Text="Query" />
                                        <br />
                                    </td>
                                </tr>
                            </caption>
                        </caption>
                    </caption>
                </table>



            </div>

        </div>
    </asp:Panel>
    <asp:Panel ID="pnlSecondStep" runat="server">
        <div class="panel panel-default" id="secondStep" style="display: none; width: 800px; margin: 0 auto;" aria-busy="True">
            <div class="panel-heading">
                Housekeeping schedule
            </div>

            <div class="panel-body">
                <div class="alert alert-danger" id="errorbox2" style="display: none;">
                </div>

                <table class="nav-justified" style="width: 781px">
                    <tr>
                        <td>
                            <asp:Button ID="PrintBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="PrintBut_Click" Text="Print Report" />
                            <%--<asp:Button ID="PrintBut" runat="server" CssClass="btn btn-default btn-lg" OnClientClick="doPrint()" Text="Print Report" />--%>
                            &nbsp;<asp:Button ID="ExcelBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="ExcelBut_Click" Text="Export to Excel" />
                            &nbsp<asp:Button ID="PDFBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="PDFBut_Click" Text="Export to PDF" />
                            &nbsp;<asp:GridView ID="gvMonday" runat="server" AllowPaging="True" Caption="Monday" class="table table-hover" CssClass="table table-bordered" OnPageIndexChanging="gvMonday_PageIndexChanging" SortExpression="Name" Width="765px">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvTuesday" runat="server" Caption="Tuesday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvTuesday_PageIndexChanging">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvWednesday" runat="server" Caption="Wednesday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvWednesday_PageIndexChanging">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvThursday" runat="server" Caption="Thursday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvThursday_PageIndexChanging">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvFriday" runat="server" Caption="Friday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvFriday_PageIndexChanging">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvSaturday" runat="server" Caption="Saturday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvSaturday_PageIndexChanging">
                            </asp:GridView>
                            <br />
                            <asp:GridView ID="gvSunday" runat="server" Caption="Sunday" class="table table-hover" CssClass="table table-bordered" Width="765px" AllowPaging="True" OnPageIndexChanging="gvSunday_PageIndexChanging">
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-center" style="height: 22px"><a href="HousekeepingReport.aspx">&lt; Go back</a></td>
                    </tr>
                </table>
            </div>
        </div>
    </asp:Panel>
    <script type="text/javascript">
        function transitionToSecondStep() {

            $('#secondStep').delay(250).show('slide', { direction: 'right', easing: 'easeOutQuart', duration: 250 });
        }
    </script>

    <script>
        function doPrint() {
            document.getElementById('gvMonday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvTuesday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvWednesday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvThursday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvFriday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvSaturday').setAttribute["AllowPaging"] = "False";
            document.getElementById('gvSunday').setAttribute["AllowPaging"] = "False";

            var prtContent = document.getElementById('<%= gvMonday.ClientID %>');
            
            var prtContent2 = document.getElementById('<%= gvTuesday.ClientID %>');
            var prtContent3 = document.getElementById('<%= gvWednesday.ClientID %>');
            var prtContent4 = document.getElementById('<%= gvThursday.ClientID %>');
            var prtContent5 = document.getElementById('<%= gvFriday.ClientID %>');
            var prtContent6 = document.getElementById('<%= gvSaturday.ClientID %>');
            var prtContent7 = document.getElementById('<%= gvSunday.ClientID %>');
            prtContent.border = 0; //set no border here
            var WinPrint = window.open('', '', 'left=100,top=100,width=1000,height=1000,toolbar=0,scrollbars=1,status=0,resizable=1');
            WinPrint.document.write(prtContent.outerHTML);
            
            WinPrint.document.write(prtContent2.outerHTML);
            
            WinPrint.document.write(prtContent3.outerHTML);
            
            WinPrint.document.write(prtContent4.outerHTML);
           
            WinPrint.document.write(prtContent5.outerHTML);
            WinPrint.document.write(prtContent6.outerHTML);
            WinPrint.document.write(prtContent7.outerHTML);
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();

        }
    </script>
    

</asp:Content>
